﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Conusic
{
    public class FileEventArgs
    {
        /// <summary>
        /// Gets or sets the full URL.
        /// </summary>
        /// <value>
        /// The URL.
        /// </value>
        public string Url { get; set; }

        /// <summary>
        /// Destination to save
        /// </summary>
        /// <value>
        /// The save to file.
        /// </value>
        public string SaveToFile { get; set; }

        public long Downloaded { get; set; }
        /// <summary>
        /// Gets the downloaded kb.
        /// </summary>
        public int DownloadedKb
        {
            get { return (int)Downloaded / 1024; }
        }
        /// <summary>
        /// Gets or sets the total.
        /// </summary>
        /// <value>
        /// The total size in bytes.
        /// </value>
        public long Total { get; set; }
        
        /// <summary>
        /// Gets the total size in kb.
        /// </summary>
        public int TotalKb
        {
            get { return (int)Total / 1024; }
        }

        /// <summary>
        /// On exception this object is not null.
        /// </summary>
        public Exception Exc { get; set; }


        /// <summary>
        /// Sometimes we need to know, who is owner
        /// </summary>
        public DownloadFile Owner { get; private set; }

        public FileEventArgs(DownloadFile owner)
        {
            this.Owner = owner;
        }
    }
}
